import request from '../utils/request'
import qs from "querystring"

export const saveOrUpdateDept = (param) => {
    return request.post("/dept",param);
}

export const deleteDeptById = (department) => {
    return request.delete("/dept/"+department);
} 

export const deleteDeptByBatch = (departmentIds) => {
    return request.delete("/dept/batchDelete?departmentIds="+departmentIds);
}

export const getDeptByCondition = (query)=>{
    return request.get("/dept/by/condition",{
        params: query,
        paramsSerializer:(params)=>{
            return qs.stringify(params);
        }
    })
}